/**
 * 
 */
package org.cuatrovientos.erp.model;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Email;

/**
 * @author pablo_guerrero
 *
 */
public class User {
	
	@Min(value=1,message="{user.id.error}")
	private int id;
	
	@NotNull(message="{user.login.error}")
	private String login;
	
	@NotNull(message="{user.password.error}")
	private String password;
	
	@NotNull(message="{user.name.error}")
	private String name;
	
	@Email(message="{user.email.error}")
	private String email;
	
	@Min(value=1,message="{user.idrole.error}")
	private int idrole;
	
	/**
	 * Default constructor
	 */
	public User(){
		
	}
	
	/**
	 * Constructor
	 * @param id
	 * @param login
	 * @param password
	 * @param name
	 * @param email
	 * @param idrole
	 */
	public User(int id, String login, String password, String name, String email, int idrole){
		this.id = id;
		this.login = login;
		this.password = password;
		this.name = name;
		this.email = email;
		this.idrole = idrole;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the login
	 */
	public String getLogin() {
		return login;
	}

	/**
	 * @param login the login to set
	 */
	public void setLogin(String login) {
		this.login = login;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the idrole
	 */
	public int getIdrole() {
		return idrole;
	}

	/**
	 * @param idrole the idrole to set
	 */
	public void setIdrole(int idrole) {
		this.idrole = idrole;
	}
}
